package com.flyduck.event.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 用户注册成功发送短信监听器
 *
 * @author flyduck 2020/10/17 15:08
 * @version V1.0
 * @modify by user: LiuHui 2020/10/17
 * @modify by reason:{原因}
 **/
@Component
public class UserRegisterSendSMSListener implements ApplicationListener<UserRegisterEvent> {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserRegisterSendSMSListener.class);

    @Override
    public void onApplicationEvent(UserRegisterEvent userRegisterEvent) {
        // 发送短信
        LOGGER.info("新注册用户 {} 短信发送成功", userRegisterEvent.getUser().getUserName());
    }
}
